package com.qiangqiang.repository;

import com.qiangqiang.entity.Sanitation;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.query.Procedure;
import org.springframework.data.repository.query.Param;

import java.util.List;

/**
 * Created by q on 2018/2/1.
 */
public interface SanitationRepository extends JpaRepository<Sanitation,Integer>{

    /**
     * 根据宿舍号查询该宿舍的卫生等级
     * @param dId
     * @return
     */
    List<Sanitation> queryAllByDId(String dId);

    /**
     * 添加一条使用违禁品记录
     */
    @Procedure(name = "insert_sanitation")
    void insertSanitation(@Param("scoreId") String scoreId, @Param("dId") String dId, @Param("level")Integer level);
}
